<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      color: red;
      /* 不继承 */
      border: 2px solid purple;
    }

    .box p {
      /* 强制继承 */
      border: inherit;
    }
  </style>
</head>

<body>
  <div class="box">
    <p>我也是p元素</p>
    <h1>我是h1元素</h1>
  </div>
</body>

</html>